<div class="ribbon">
    <a href=""><span class="home fa fa-home"></span></a>
    <ol class="breadcrumb">
        <li>用户列表</li>
    </ol>
</div>

<div class="table-wrapper">

    <div class="toolbar">
        <form role="form">
            <div class="inline-group">
                <label class="input"><input type="text" class="form-control input-sm" ng-model="q.userId" ng-change="search()" placeholder="用户名"> </label>
                <label class="input"><input type="text" class="form-control input-sm" ng-model="q.userName" ng-change="search()" placeholder="用户姓名"> </label>
                <button type="submit" class="btn btn-sm btn-primary" ng-click="search()"><i class="fa fa-search"></i> 搜索 </button>
                <label class="input col-sm-offset-1">角色：<select  class="input-sm" ng-model="q.userGroup" ng-options="userGroup.name for userGroup in vm.userGroups" class="form-control" ng-selected="" ng-change="search()"></select></label>

                <label class="input" col-sm-offset-1><input type="text" class="form-control input-sm" ng-model="q.liableDepartmentCode" ng-change="search()" placeholder="责任部门"> </label>

                <span class="glyphicon glyphicon-calendar" ng-click="initDepartmentSelect()"></span>
                <button type="button" class="btn btn-sm btn-success pull-right" ng-click="initPopUp()"><i class="fa fa-plus"></i> 新增用户 </button>
            </div>
        </form>
    </div>
    <table class="table table-striped table-hover props table-sm">
        <thead>
        <tr>

            <th width="1%"></th>
            <th width="5%">序号</th>
            <th width="8%">用户名</th>
            <!--<th width="5%">密码</th>-->
            <th width="5%">姓名</th>
            <th width="10%">身份证</th>
            <th width="5%">角色</th>
            <th width="8%">部门</th>
            <th width="8%">工号</th>
            <th width="8%">手机号</th>
            <th width="8%">座机</th>
            <th width="8%">邮箱</th>
            <th width="8%">在线状态</th>
            <th width="8%">抢单权限</th>
            <th width="15%">操作</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="user in vm.userList">
            <td></td>
            <td class="message">{{$index+1+pager.pageSize*(pager.getCurPageNo()-1)}}</td>
            <td class="message">{{user.userId}}</td>
            <!--<td class="message">{{user.password}}</td>-->
            <td class="message">{{user.name}}</td>
            <td class="message">{{user.identity}}</td>
            <td class="message">{{user.userGroup.name}}</td>
            <td class="message">{{user.department.name}}</td>
            <td class="message">{{user.jobNumber}}</td>
            <td class="message">{{user.mobilePhone}}</td>
            <td class="message">{{user.officePhone}}</td>
            <td class="message">{{user.email}}</td>
            <td class="message">{{user.aliveStatus.name}}</td>
            <td class="message">{{user.serviceStatus.name}}</td>
            <td class="operate">
                <!--<button title="详情" ng-click="viewDetails(user)" type="button" class="btn btn-primary btn-outline btn-xs">-->
                    <!--<i class="fa fa-info-circle"></i>-->
                <!--</button>-->
                <button title="修改" ng-click="modify(user)" type="button" class="btn btn-primary btn-outline btn-xs">
                    <i class="fa fa-edit"></i>
                </button>
                <button title="删除" ng-click="delete(user)" type="button" class="btn btn-primary btn-outline btn-xs">
                    <i class="fa fa-trash-o"></i>
                </button>
                <button title="照片" ng-click="uploadImage(user)" type="button" class="btn btn-primary btn-outline btn-xs">
                    <i class="">照片</i>
                </button>
                <button ng-click="changeServiceStatus(user)" type="button" class="btn btn-primary btn-outline btn-xs">
                    <i class="" ng-if="user.serviceStatus.index==0">禁用</i>
                    <i class="" ng-if="user.serviceStatus.index!=0">恢复</i>
                </button>
            </td>
        </tr>
        </tbody>
    </table>
    <div ng-if="vm.userList.length == 0" nj-table-no-data></div>
    <div nj-pager pager="pager"></div>
</div>
